package com.ivo.util.extjs;

import java.util.ArrayList;
import java.util.List;

public class TreeNode {

	private String id;
	private String text;
	private String cls;
	private String iconCls;
	private boolean leaf;
	private List<TreeNode> children;
		
	public TreeNode( String id, String text, String cls, String iconCls, boolean leaf ) {
		this.id = id;
		this.text = text;
		this.cls = cls;
		this.iconCls = iconCls;
		this.leaf = leaf;
	}

	public TreeNode( String id, String text ) {
		this.id = id;
		this.text = text;
	}
	
	public TreeNode() {
	}
	
	public String getId() {
		return id;
	}
	public void setId( String id ) {
		this.id = id;
	}
	
	public String getText() {
		return text;
	}
	public void setText( String text ) {
		this.text = text;
	}
	
	public boolean getLeaf() {
		return leaf;
	}
	public void setLeaf( boolean leaf ) {
		this.leaf = leaf;
	}
	
	public List<TreeNode> getChildren() {
		return children;
	}
	public void setChildren( List<TreeNode> children ) {
		this.children = children;
	}
	
	public void addChild(TreeNode treeNode) {
		if(this.children==null) this.children = new ArrayList<TreeNode>();
		this.children.add(treeNode);
	}
	public String getIconCls() {
		return iconCls;
	}
	
	public void setIconCls( String iconCls ) {
		this.iconCls = iconCls;
	}
	
	public String getCls() {
		return cls;
	}
	public void setCls( String cls ) {
		this.cls = cls;
	}
}
